﻿package mortal.game.view.copy.defenseCopy
{
    import com.mui.controls.*;
    import com.mui.events.*;
    import extend.language.*;
    import mortal.common.*;
    import mortal.component.window.*;
    import mortal.game.view.common.*;
    import mortal.game.view.copy.defenseCopy.view.*;
    import mortal.game.view.wizard.*;
    import mortal.mvc.interfaces.*;

    public class DefenseCopyShopNew extends BaseWindow
    {
        private var _tabBar:GTabarNew;
        private var _curView:GSprite;
        private static var _instance:DefenseCopyShopNew;

        public function DefenseCopyShopNew(param1:ILayer = null)
        {
            super(param1);
            this.setSize(890, 605);
            title = Language.getString(70870);
            return;
        }// end function

        private function tabBarChangeHandler(event:MuiEvent = null) : void
        {
            DefenseCopyShopEquipView.instance.tabBarIndex = this._tabBar.selectedIndex + 1;
            return;
        }// end function

        override protected function createDisposedChildrenImpl() : void
        {
            super.createDisposedChildrenImpl();
            this._tabBar = UIFactory.gTabBarNew(4, 30, Language.getArray(50151), 888, 605, 65, 24, this, this.tabBarChangeHandler, "TabButtonNew");
            this._tabBar.selectedIndex = 0;
            UIFactory.setObjAttri(DefenseCopyShopEquipView.instance, 0, 50, -1, -1, this);
            this.tabBarChangeHandler();
            return;
        }// end function

        override protected function disposeImpl(param1:Boolean = true) : void
        {
            super.disposeImpl(param1);
            this._tabBar.dispose(param1);
            DisplayUtil.removeMe(DefenseCopyShopEquipView.instance);
            return;
        }// end function

        public static function get instance() : DefenseCopyShopNew
        {
            if (!_instance)
            {
                _instance = new DefenseCopyShopNew;
            }
            return _instance;
        }// end function

        public static function get hasInstance() : Boolean
        {
            return _instance != null;
        }// end function

    }
}
